package org.seedltd.upms.model.detection.form;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.seedltd.core.jackson.annotation.JsonStrToFiled;
import org.seedltd.core.validation.Save;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 *
 * 订单退款信息表单
 * 
 * @author laizuan
 * @version 1.0
 * @since 2021/07/31
 */
@Getter
@Setter
public class DetectionOrderBindingForm {

    /**
     * 订单主键
     */
    @NotNull(message = "订单主键不能为空", groups = {Save.class})
    private Long orderId;

    /**
     * 二维码
     */
    @NotNull(message = "二维码编号不能为空", groups = {Save.class})
    private String codeNumber;

    /**
     * 样板采集时间
     */
    @NotNull(message = "样板采集时间不能为空", groups = {Save.class})
    private Date sampleTime;

    /**
     * 采样者名字
     */
    @Length(message = "采样者名字长度不能超过10个字符", max = 10, groups = {Save.class})
    @NotBlank(message = "采样者名字不能为空", groups = {Save.class})
    private String username;

    /**
     * 采样者年纪
     */
    @Max(value = 150, message = "年龄不能超过150岁")
    @Min(value = 3, message = "年龄小于3岁")
    @NotNull(message = "采样者年纪不能为空", groups = {Save.class})
    private Integer age;

    /**
     * 性别
     */
    @JsonStrToFiled
    @NotNull(message = "性别不能为空", groups = {Save.class})
    private Integer gender;

    /**
     * 手机号
     */
    @Length(message = "手机号长度不能超过14个字符", max = 14, groups = {Save.class})
    @NotBlank(message = "手机号不能为空", groups = {Save.class})
    private String mobile;

    /**
     * 样本类型
     */
    @JsonStrToFiled
    @Length(message = "样本类型长度不能超过20个字符", max = 20, groups = {Save.class})
    @NotBlank(message = "样本类型不能为空", groups = {Save.class})
    private String sampleType;

}
